﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using ParticleSystem;
namespace BGSpaceShooter
{
    public class StarFighterComponent : BGSpaceShooterServer.StarFighterComponent
    {
        private IObjectEffect smokeEffect;

        public StarFighterComponent(GameObject gameObject)
        {
            smokeEffect = new FireSmokeEffect(gameObject, this);
            smokeEffect.IsActive = false;
        }


        public IEnumerable<IObjectEffect> GetEffects()
        {
            if (smokeEffect.IsActive)
                return new List<IObjectEffect>() { smokeEffect };
            return new List<IObjectEffect>();
        }

        public override int HP
        {
            get
            {
                return base.HP;
            }
            set
            {
                base.HP = value;
                if (base.HealthPercent < 0.8)
                    smokeEffect.IsActive = true;
                else
                {
                    smokeEffect.IsActive = false;
                }
            }
        }
    }
}
